#pragma once

#include <QString>
#include <QMap>
#include <QList>
#include "VTranslate.h"

class VOutputInformation
{
public:
	enum Type
	{
		NORMAL,
		WARNING,
        ERROR,
	};

    struct STDError
    {
        QString replace;
        QString source;
        QString type;
        STDError(){}
        STDError(QString source, QString replace, QString type)
        {
            this->source = source;
            this->replace = replace;
            this->type = type;
        }
    };

    struct CustomError
    {
        QString content_replace;
        QString content_source;
        QString path;
        QString type;
        CustomError(){}
        CustomError(QString content_source, QString content_replace, QString path, QString type)
        {
            this->content_source = content_source;
            this->content_replace = content_replace;
            this->path = path;
            this->type = type;
        }
    };

    VOutputInformation(QString text);
	~VOutputInformation();

    static QMap<int, VOutputInformation::STDError> _std_error;
    static QList<VOutputInformation::CustomError> _custom_error;
    static void init();


    QString _type;
	int _line_number = -1;
	int _error_number = -1;
	QString _path;
    QString _text;
private:
	int err_number(QString text);
	QString get_path(QString text);
	int get_line_number(QString text);
};

